﻿<Window x:Class="Clock.Windows.DualClock"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:Clock.Properties" Height="200" Width="422" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="Transparent" FontFamily="/Home.Base;component/Fonts/#Droid Sans Mono"
        SourceInitialized="WindowSourceInitialized" Loaded="WindowLoaded" MouseMove="WindowMouseMove" MouseLeftButtonUp="WindowMouseLeftButtonUp" MouseEnter="ThisMouseEnter"
        MouseLeave="ThisMouseLeave">
    <Window.Resources>
        <Storyboard x:Key="FirstClockLoadAnim" Completed="FirstClockLoadAnimCompleted" BeginTime="0:0:0.5">
            <DoubleAnimation Storyboard.TargetName="FirstClockHourRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
            <DoubleAnimation Storyboard.TargetName="FirstClockMinuteRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
            <DoubleAnimation Storyboard.TargetName="FirstClockSecondRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
        </Storyboard>
        <Storyboard x:Key="SecondClockLoadAnim" Completed="SecondClockLoadAnimCompleted" BeginTime="0:0:0.5">
            <DoubleAnimation Storyboard.TargetName="SecondClockHourRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
            <DoubleAnimation Storyboard.TargetName="SecondClockMinuteRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
            <DoubleAnimation Storyboard.TargetName="SecondClockSecondRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
        </Storyboard>
        <Storyboard x:Key="MouseEnter">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseEnterCompleted"/>
        </Storyboard>
        <Storyboard x:Key="MouseLeave">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseLeaveCompleted"/>
        </Storyboard>
    </Window.Resources>
    <Window.RenderTransform>
        <ScaleTransform x:Name="Scale" ScaleX="1" ScaleY="{Binding ElementName=Scale, Path=ScaleX}"/>
    </Window.RenderTransform>
    <Window.ContextMenu>
        <ContextMenu>
            <MenuItem Name="PinItem" Header="{x:Static Properties:Resources.Pin}" IsCheckable="True" Click="PinItemClick"/>
            <MenuItem Name="TopMostItem" Header="{x:Static Properties:Resources.TopMost}" IsCheckable="True" Click="TopMostItemClick"/>
            <MenuItem Name="OptionsItem" Header="{x:Static Properties:Resources.OptionsItem}" Click="OptionsItemClick"/>
            <MenuItem Name="CloseItem" Header="{x:Static Properties:Resources.CloseItem}" Click="CloseItemClick"/>
        </ContextMenu>
    </Window.ContextMenu>
    <DockPanel>
        <Grid Name="ClockNameGrid" DockPanel.Dock="Bottom" Height="25" Margin="0,15,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid HorizontalAlignment="Center">
                <Rectangle RadiusX="12" RadiusY="12" Fill="Black" Opacity="0.5"/>
                <TextBlock Name="FirstClockNameTextBlock" Text="Local time" Foreground="White" Margin="10,0,10,0" VerticalAlignment="Center" FontSize="14" MaxWidth="170" TextTrimming="CharacterEllipsis"/>
            </Grid>
            <Grid Grid.Column="1" HorizontalAlignment="Center">
                <Rectangle RadiusX="12" RadiusY="12" Fill="Black" Opacity="0.5"/>
                <TextBlock Name="SecondClockNameTextBlock" Text="UTC" Foreground="White" Margin="10,0,10,0" VerticalAlignment="Center" FontSize="14" MaxWidth="170" TextTrimming="CharacterEllipsis"/>
            </Grid>
        </Grid>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Image Grid.ColumnSpan="2" Source="/Resources/DualClock/clock_bg.png" Margin="0,10,0,0"/>
            <Grid Name="FirstClock" Margin="-10,0,-10,-10">
                <Image Name="FirstClockBg" Source="/Resources/DualClock/clock_base_day.png"/>
                <Image Name="FirstClockHour" Source="/Resources/DualClock/clock_hour.png" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <RotateTransform x:Name="FirstClockHourRotate"/>
                    </Image.RenderTransform>
                </Image>
                <Image Name="FirstClockMinute" Source="/Resources/DualClock/clock_minute.png" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <RotateTransform x:Name="FirstClockMinuteRotate"/>
                    </Image.RenderTransform>
                </Image>
                <Image Name="FirstClockSecond" Source="/Resources/DualClock/clock_second.png" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <RotateTransform x:Name="FirstClockSecondRotate"/>
                    </Image.RenderTransform>
                </Image>
                <Image Name="FirstClockDot" Source="/Resources/DualClock/clock_center_dot.png"  Margin="2,0,4,4"/>
            </Grid>
            <Grid Grid.Column="1" Name="SecondClock" Margin="-10,0,-10,-10">
                <Image Name="SecondClockBg" Source="/Resources/DualClock/clock_base_day.png"/>
                <Image Name="SecondClockHour" Source="/Resources/DualClock/clock_hour.png" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <RotateTransform x:Name="SecondClockHourRotate"/>
                    </Image.RenderTransform>
                </Image>
                <Image Name="SecondClockMinute" Source="/Resources/DualClock/clock_minute.png" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <RotateTransform x:Name="SecondClockMinuteRotate"/>
                    </Image.RenderTransform>
                </Image>
                <Image Name="SecondClockSecond" Source="/Resources/DualClock/clock_second.png" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <RotateTransform x:Name="SecondClockSecondRotate"/>
                    </Image.RenderTransform>
                </Image>
                <Image Name="SecondClockDot" Source="/Resources/DualClock/clock_center_dot.png"  Margin="2,0,4,4"/>
            </Grid>
        </Grid>
    </DockPanel>
</Window>
